package com.zlict.admin.service.impl;

import java.util.List;
import com.zlict.common.utils.DateUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.zlict.admin.mapper.ProjectDeviceWorkingHoursMapper;
import com.zlict.admin.domain.ProjectDeviceWorkingHours;
import com.zlict.admin.service.IProjectDeviceWorkingHoursService;

/**
 * 项目设备工时Service业务层处理
 * 
 * @author lqh
 * @date 2025-06-26
 */
@Service
@RequiredArgsConstructor
public class ProjectDeviceWorkingHoursServiceImpl implements IProjectDeviceWorkingHoursService 
{
    private final ProjectDeviceWorkingHoursMapper projectDeviceWorkingHoursMapper;

    /**
     * 查询项目设备工时
     * 
     * @param id 项目设备工时主键
     * @return 项目设备工时
     */
    @Override
    public ProjectDeviceWorkingHours selectProjectDeviceWorkingHoursById(String id)
    {
        return projectDeviceWorkingHoursMapper.selectProjectDeviceWorkingHoursById(id);
    }

    /**
     * 查询项目设备工时列表
     * 
     * @param projectDeviceWorkingHours 项目设备工时
     * @return 项目设备工时
     */
    @Override
    public List<ProjectDeviceWorkingHours> selectProjectDeviceWorkingHoursList(ProjectDeviceWorkingHours projectDeviceWorkingHours)
    {
        return projectDeviceWorkingHoursMapper.selectProjectDeviceWorkingHoursList(projectDeviceWorkingHours);
    }

    /**
     * 新增项目设备工时
     * 
     * @param projectDeviceWorkingHours 项目设备工时
     * @return 结果
     */
    @Override
    public int insertProjectDeviceWorkingHours(ProjectDeviceWorkingHours projectDeviceWorkingHours)
    {
        projectDeviceWorkingHours.setCreateTime(DateUtils.getNowDate());
        return projectDeviceWorkingHoursMapper.insertProjectDeviceWorkingHours(projectDeviceWorkingHours);
    }

    /**
     * 修改项目设备工时
     * 
     * @param projectDeviceWorkingHours 项目设备工时
     * @return 结果
     */
    @Override
    public int updateProjectDeviceWorkingHours(ProjectDeviceWorkingHours projectDeviceWorkingHours)
    {
        projectDeviceWorkingHours.setUpdateTime(DateUtils.getNowDate());
        return projectDeviceWorkingHoursMapper.updateProjectDeviceWorkingHours(projectDeviceWorkingHours);
    }

    /**
     * 批量删除项目设备工时
     * 
     * @param ids 需要删除的项目设备工时主键
     * @return 结果
     */
    @Override
    public int deleteProjectDeviceWorkingHoursByIds(String[] ids)
    {
        return projectDeviceWorkingHoursMapper.deleteProjectDeviceWorkingHoursByIds(ids);
    }

    /**
     * 删除项目设备工时信息
     * 
     * @param id 项目设备工时主键
     * @return 结果
     */
    @Override
    public int deleteProjectDeviceWorkingHoursById(String id)
    {
        return projectDeviceWorkingHoursMapper.deleteProjectDeviceWorkingHoursById(id);
    }
}
